package XComponent.show
{
	import XComponent.XComponents;
	import XComponent.show.core.XUIComonent;
	
	import fl.controls.Button;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;

	public class XFrame extends XBitmapScale9Grid
	{
		
		public function XFrame(skinId : String = "Frame_activeBG")
		{
			setStyle(skinId);
		}
		
		public function setStyle(skinId : String):void
		{
			clearChildrean();
			
			var layerBitInfo : Object = XComponents.getImgData(skinId);
			
			var clas : Class = XComponents.getSkin(layerBitInfo["className"]);
			var bit : Bitmap = new Bitmap(new clas);
			
			super.Init(new Bitmap(new clas),layerBitInfo["scaleGridTop"], layerBitInfo["scaleGridBottom"], layerBitInfo["scaleGridLeft"], layerBitInfo["scaleGridRight"]);
		}
		
		public function clearChildrean() : void
		{
			for(var i:int = this.numChildren-1;i>=0;i--)
			{
				this.removeChildAt(i);
			}
		}
	}
}